<template>
  <div>
    <!-- 子组件 -->
    <ChildVue @add="handleAdd" />

    <!-- 父 -->
    <div class="child">
      <ul class="list-group">
        <li class="list-item" v-for="item in list" :key="item">{{ item }}</li>
      </ul>
    </div>
  </div>
</template>

<script setup>
import ChildVue from './Child.vue';
import { ref } from 'vue';

const list = ref(['JavaScript', 'HTML', 'CSS'])

const handleAdd = value => {  // 事件名称，接收
  console.log(value);
  list.value.push(value)
}
</script>

<style>
</style>